﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class PackView : MonoBehaviour {

    public GameObject prefab;

	public void RenderViewToModel(List<PackModel> packModelList)
    {
        this.prefab = Resources.Load("PackItem") as GameObject;

        foreach(var item in packModelList)
        {
            GameObject go = GameObject.Instantiate(prefab) as GameObject;
            go.transform.parent = this.transform;
            PackItem packItem = go.GetComponent<PackItem>();
            packItem.SetModel(item);
        }
    }
}
